package com.olymtech.jbricks.dingtalk.message.delivery.msg;

import com.olymtech.jbricks.dingtalk.message.Message;
import com.olymtech.jbricks.dingtalk.message.MessageType;
import com.taobao.api.TaobaoObject;

/**
 * @author haoting.wang
 * @date 2020/12/10 2:30 下午
 **/
public class ChatMessageFactory extends MessageFactory {

    @Override
    public TaobaoObject conversationMessage(Message message) {

        if (MessageType.TEXT.equals(message.type())) {
            return ChatMessageService.convertText(message);
        }

        if (MessageType.LINK.equals(message.type())) {
            return ChatMessageService.convertLink(message);
        }

        return null;
    }
}
